home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form Full
- BackColor = &H00800000&
- BorderStyle = 0 'None
- Caption = "Form2"
- ClientHeight = 3510
- ClientLeft = 2760
- ClientTop = 2520
- ClientWidth = 4365
- ClipControls = 0 'False
- Height = 3915
- HelpContextID = 5
- KeyPreview = -1 'True
- Left = 2700
- LinkTopic = "Form2"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 3510
- ScaleWidth = 4365
- Top = 2175
- Width = 4485
- Begin Timer Timer2
- Interval = 1000
- Left = 1860
- Top = 900
- End
- Begin Timer Timer1
- Enabled = 0 'False
- Interval = 1
- Left = 960
- Top = 840
- End
- Begin Label TimeLabel
- Alignment = 2 'Center
- BackStyle = 0 'Transparent
- FontBold = -1 'True
- FontItalic = -1 'True
- FontName = "Arial"
- FontSize = 48
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- ForeColor = &H000000C0&
- Height = 1095
- Left = 240
- TabIndex = 0
- Top = 1440
- Visible = 0 'False
- Width = 4050
- End
- Begin Image Image1
- Height = 2115
- Left = 180
- Top = 180
- Width = 2655
- End
- Dim Shared slide2 As Integer
- Dim Shared zoom As Single
- Sub form_click ()
- loop1 = 0: Timer1.Enabled = False: slide2 = 0: Unload Full
- Main.Timer1.Enabled = True: Main.Timer2.Enabled = True
- End Sub
- Sub Form_KeyDown (keycode As Integer, shift As Integer)
- 'Move the picture according to the key pressed
- 'Home,End,Page Dn,Page Up,Arrow Keys,Return
- If keycode = 35 Then image1.Left = (Width - image1.Width)
- If keycode = 33 Then image1.Top = 0
- If keycode = 36 Then image1.Left = 0
- If keycode = 34 Then image1.Top = (Height - image1.Height)
- If keycode = 39 Then
- If image1.Width + image1.Left <= 50 Then Exit Sub
- image1.Left = image1.Left - (50 * (zoom + 1))
- End If
- If keycode = 37 Then
- If image1.Left >= Width - 50 Then Exit Sub
- image1.Left = image1.Left + (50 * (zoom + 1))
- End If
- If keycode = 40 Then
- If image1.Height + image1.Top <= 50 Then Exit Sub
- image1.Top = image1.Top - (50 * (zoom + 1))
- End If
- If keycode = 38 Then
- If image1.Top >= Height - 50 Then Exit Sub
- image1.Top = image1.Top + (50 * (zoom + 1))
- End If
- If keycode = 13 Then
- image1.Left = (Width - image1.Width) / 2
- image1.Top = (Height - image1.Height) / 2
- End If
- End Sub
- Sub Form_KeyPress (keyascii As Integer)
- If keyascii = 27 Then Call form_click: Exit Sub
- End Sub
- Sub form_load ()
- On Error GoTo Nopicture
- zoom = 0: If slide = 1 Then slide2 = 1
- image1.Visible = False
- 'Maximize form
- Left = 0
- Top = 0
- Width = screen.Width
- Height = screen.Height
- image1.Width = 1
- image1.Height = 1
- 'Center TimeLabel
- TimeLabel.Left = (Width - TimeLabel.Width) / 2
- TimeLabel.Top = (Height - TimeLabel.Height) / 2
- 'Exit if selected multiple files
- If slide = 1 Then Exit Sub
- 'Load the picture in the image control
- image1.Picture = LoadPicture(PictureName$)
- 'Center picture
- image1.Left = (Width - image1.Width) / 2
- image1.Top = (Height - image1.Height) / 2
- 'If picture bigger than screen...
- If image1.Width > Width Then image1.Left = 0
- If image1.Height > Height Then image1.Top = 0
- image1.Visible = True
- Exit Sub
- 'Error-Handler if loaded file isn't valid
- Nopicture:
- Beep: MsgBox Main.File1.List(loop1) + " is" + Chr$(10) + "an " + Error$(Err), 16, "Error": Resume Nopicture2:
- Nopicture2:
- Call form_click
- End Sub
- Sub Image1_Click ()
- If slide2 = 0 Then Exit Sub
- If delay <> 0 Then Timer1.Interval = 1
- Call Timer1_Timer
- End Sub
- Sub Image1_DblClick ()
- loop1 = 0: Timer1.Enabled = False: slide2 = 0: Unload Full
- Main.Timer1.Enabled = True: Main.Timer2.Enabled = True
- End Sub
- Sub Image1_MouseDown (Button As Integer, shift As Integer, X As Single, Y As Single)
- 'Exit if user selected multiple files
- If slide2 <> 0 Then Exit Sub
- 'Exit if right mouse button not clicked
- If Button <> 2 Then Exit Sub
- 'User only clicked right mouse button
- 'This increases the size of the image
- If shift = 0 Then
- zoom = zoom + 5: If zoom = 25 Then zoom = 0
- image1.Width = 1
- image1.Height = 1
- image1.Visible = False
- image1.Stretch = False
- image1.Width = image1.Width * (1 + zoom / 5)
- image1.Height = image1.Height * (1 + zoom / 5)
- End If
- 'User clicked right mouse button while holding down [Shift]
- 'This decreases the size of the image
- If shift = 1 Then
- zoom = zoom - 5: If zoom = -5 Then zoom = 20
- image1.Width = 1
- image1.Height = 1
- image1.Visible = False
- image1.Stretch = False
- image1.Width = image1.Width * (1 + zoom / 5)
- image1.Height = image1.Height * (1 + zoom / 5)
- End If
- 'User clicked right mouse button while holding down [Ctrl]
- 'If time displayed, undisplay and visa versa
- If shift = 2 Then
- If TimeLabel.Visible = False Then TimeLabel.Visible = True Else TimeLabel.Visible = False
- End If
- 'Redisplay image centered
- image1.Stretch = True
- image1.Left = (Width - image1.Width) / 2
- image1.Top = (Height - image1.Height) / 2
- image1.Visible = True
- End Sub
- Sub TimeLabel_MouseDown (Button As Integer, shift As Integer, X As Single, Y As Single)
- 'Exit if user selected multiple files
- If slide2 <> 0 Then Exit Sub
- 'Exit if right mouse button not clicked
- If Button <> 2 Then Exit Sub
- 'User clicked right mouse button while holding down [Ctrl]
- 'If time displayed, undisplay and visa versa
- If shift = 2 Then
- If TimeLabel.Visible = False Then TimeLabel.Visible = True Else TimeLabel.Visible = False
- End If
- End Sub
- Sub Timer1_Timer ()
- Static loop1 As Integer
- On Error GoTo novis
- begin:
- slide = 0
- 'Exit if all pictures have been processed and recycle is off
- If loop1 = Main.File1.ListCount Then
- loop1 = 0: If cycle = 0 Then Call form_click: Exit Sub
- End If
- 'If picture is selected then ...
- If Main.File1.Selected(loop1) = True Then
- PictureName$ = Main.Dir1.Path
- If Right$(PictureName$, 1) <> "\" Then PictureName$ = PictureName$ + "\"
- PictureName$ = PictureName$ + Main.File1.List(loop1)
- Call form_load
- Timer1.Interval = delay * 1000
- loop1 = loop1 + 1
- Exit Sub
- End If
- '... if not, continue loop with smallest delay
- loop1 = loop1 + 1: Timer1.Interval = 1
- 'Error-Handler
- novis:
- Resume novis2:
- novis2:
- Exit Sub
- End Sub
- Sub Timer2_Timer ()
- 'Display the time
- TimeLabel.Caption = Left$(Time$, 8)
- End Sub
-